#pragma once

#define NAMESIZE 10
enum SHAPETYPE {LINE, RECT, TRIANGLE, CIRCLE};

class Shape
{
public:
	Shape() { }

	Shape(int shapeType) : type(shapeType) { 	}

	virtual ~Shape() {}

	virtual void draw() = 0;

	virtual int isInside(int x, int y) = 0;

	virtual double distance(int x, int y) = 0;

	int getType() const { return type; }

private:
	int type;
};

class Line : public Shape
{
public:
	Line() : Shape(LINE) { }
	Line(int shapeType) : Shape(shapeType) { }
	~Line() { }
	void draw();
	int isInside(int x, int y);
	double distance(int x, int y);

private:
	int point_x1, point_y1;
	int point_x2, point_y2;
};

class Rect : public Shape
{
public:
	Rect() : Shape(RECT) { }
	Rect(int shapeType) : Shape() { }
	~Rect() { }
	void draw();
	int isInside(int x, int y);
	double distance(int x, int y);

private:
	int point_x1, point_y1;
	int point_x2, point_y2;
};

class Triangle : public Shape
{
public:
	Triangle() : Shape(TRIANGLE) { }
	Triangle(int shapeType) : Shape(shapeType) { }
	~Triangle() { }
	void draw();
	int isInside(int x, int y);
	double distance(int x, int y);

private:
	int point_x1, point_y1;
	int point_x2, point_y2;
	int point_x3, point_y3;
};

class Circle : public Shape
{
public:
	Circle() : Shape(CIRCLE) { }
	Circle(int shapeType) : Shape(shapeType) { }
	Circle(int x1, int y1, int r) : Shape(CIRCLE), point_x1(x1), point_y1(y1), radius(r) { };
	~Circle() { }
	void draw();
	int isInside(int x, int y);
	double distance(int x, int y);

private:
	int point_x1, point_y1;
	int radius;
};
